<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel backend\models\MajorSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Majors';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="major-index">

    <?php Pjax::begin(); ?>
    <div class="panel">
		<div class="panel-heading panel-heading-auto">
            <?php echo $this->render('_search', ['model' => $searchModel]); ?>
		</div>
        <div class="panel-body">
		<p>
        	<?= Html::a('新增', ['create'], ['class' => 'btn btn-success']) ?>
    	</p>
	    <?= GridView::widget([
	        'layout' => "{items}\n{pager}",
	        'tableOptions' => ['class' => 'table table-hover table-bordered'],
	        'dataProvider' => $dataProvider,
	        //'filterModel' => $searchModel,
	        'columns' => [
	            ['class' => 'yii\grid\SerialColumn', 'header' => '序号'],
	
	            //'ID',
	            //'XXID',
	            [
	                'attribute' => 'XXID',
	                'label' => '学校',
	                'value' => function ($model){ return $model->xX->ZWMC; },
	            ],
	            // 'BMID',
	            'ZYDM',
	            'ZYMC',
	            //'ZYJC',
	            //'BXZYBH',
	            //'ZYJS:ntext',
	            //'KSSJ',
	            //'CXSJ',
	            'ZYMLBB',
	            'ZYLB',
	            //'ZYFX',
	            'ZSLB',
	            'XZ',
	            'JXXS',
	            //'ZXF',
	            //'BXXF',
	            //'SFGK',
	            //'SFSN',
	            'ZSZG',
	            [
                    'attribute' => 'ZT',
                    'value' =>  function ($model){  if($model->ZT == 0){return "待审核";}
                                    else if($model->ZT == -1){return "驳回";}
                                    else if($model->ZT == 1){return "已批准";} 
                                },
                ],
	
	            ['class' => 'yii\grid\ActionColumn', 'header'=>'操作'],
	        ],
	    ]); ?>

		</div>
	</div>
    <?php Pjax::end(); ?>

</div>
